<?php

namespace app\admin\model\offline;

use think\Model;


class OfflineInformation extends Model
{
    // 表名
    protected $name = 'offline_information';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    protected $type = [
        'createtime' => 'datetime:Y-m-d H:i:s',
        'updatetime' => 'datetime:Y-m-d H:i:s',
    ];

    // 追加属性
    protected $append = [

    ];


    protected function getTableName()
    {
        return $this->name;
    }

    public function user()
    {
        return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function users()
    {
        return $this->belongsTo('app\admin\model\User', 'to_user_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
